<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const arr = ['red', 'blue', 'pink']

        // 1.数组map方法
        const newArr = arr.map(function (ele, index) {
            return ele + '颜色'
        })
        console.log(newArr);

        // 2.数组join方法
        console.log(newArr.join());//默认逗号隔开
        console.log(newArr.join(''));//没有分隔符
        console.log(newArr.join('|'));//用|隔开

    </script>

</body>

</html>